package com.easpeed.user

import android.app.Activity
import android.content.Context
import android.content.SharedPreferences
import android.content.SharedPreferences.Editor
import android.content.pm.ActivityInfo
import android.os.Bundle
import android.preference.PreferenceManager
import androidx.fragment.app.FragmentActivity
import com.blankj.utilcode.util.ScreenUtils
import com.easpeed.common.CommonConsts

/**
 * Created by bigyu on 2024/10/30 20:11
 * com.easpeed.user
 */
abstract class UserBaseActivity : FragmentActivity() {


    lateinit var sp: SharedPreferences
    lateinit var editor: Editor
    lateinit var mContext: Context
    lateinit var mActivity: FragmentActivity

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        if (CommonConsts.isPad) {
            if (getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
                requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
            }
        }
        sp = PreferenceManager.getDefaultSharedPreferences(applicationContext)
        editor = sp.edit()
        mContext = this
        mActivity = this

        initView()

    }

    override fun onResume() {
        super.onResume()
    }

    abstract fun initView()
}